package cn.edu.neu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.neu.mapper.BookMapper;
import cn.edu.neu.model.Book;

@Service
@Transactional
public class BookServiceImpl implements BookService {

	@Resource
	private BookMapper mapper;

	@Override
	public int addBook(String name, String bMname, String bCname, String seat, String num, String price, String time,
			String status, String bimg) {
		int add = mapper.addBook(name, bMname, bCname, seat, num, price, time, status, bimg);
		return 0;
	}

	@Override
	public List<Book> findBookByName(String name) {
		List<Book> book = mapper.findBookByName(name);
		return book;
	}

	@Override
	public void updateStatusById(String bId) {
		// TODO Auto-generated method stub
		mapper.updateStatusById(bId);
	}

	@Override
	public void delBook(String bId) {
		// TODO Auto-generated method stub
		mapper.delBook(bId);
	}

	@Override
	public List<Book> findBookByCinemaName(String bCname) {
		List<Book> books = mapper.findBookByCinemaName(bCname);
		return books;
	}

}
